<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>

<link rel="stylesheet" type="text/css" href="<c:url value="/resources/css/header.css"/>" />

<header>

<div class="project">
	  <a href="<c:url value="/subscriber/home"/>" class="navbar-brand"> Telephone Exchange </a>
	</div>

  <form:form commandName="activeMenu">
  
	<ul class="nav nav-pills pull-right">
	
	  <c:if test="${activeMenu == 'profile'}">
        <li class="active"> 
          <a href="<c:url value="/subscriber/profile" />">${username}</a>
        </li>
      </c:if>
      <c:if test="${activeMenu != 'profile'}">
        <li> 
          <a href="<c:url value="/subscriber/profile" />">${username}</a>
        </li>
      </c:if>
      
      
      <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Accounts <b class="caret"></b></a>
        <ul class="dropdown-menu">
          <c:forEach var="account" items="${accounts}">
              <li><a href="<c:url value="subscriber/accounts/${account.id}" />">+${account.telephoneNumber.countryCode}-${account.telephoneNumber.operatorCode}-${account.telephoneNumber.number}</a></li>
          </c:forEach>
          <li class="divider"></li>
          <li><a href="createAccount">Create new account</a></li>
        </ul>
      </li>

      <li> 
        <a href="<c:url value="/j_spring_security_logout" />">Logout</a> 
      </li>
      
      
    </ul>
    
  </form:form>
    
</header>